package com.heima.controller;


import cn.hutool.core.bean.BeanUtil;
import com.heima.pojo.TaskType;
import com.heima.pojo.vo.TaskTypeVo;
import com.heima.service.ITaskTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 工单类型 前端控制器
 *
 * @author xjy
 * @since 2024-06-07
 */
@RestController
@RequestMapping("/task-service/taskType")
@Api(tags = "工单类型")
public class TaskTypeController {
    @Autowired
    private ITaskTypeService taskTypeService;

    @GetMapping("/list")
    @ApiOperation("工单类型列表")
    public List<TaskTypeVo> list() {
        List<TaskType> list = taskTypeService.list();
        return BeanUtil.copyToList(list, TaskTypeVo.class);
    }
}
